##################################################################
# File : /lua/maui/histogram.lua
# Description : Histogram control
# Author : GPG
##################################################################

local Control = import('control.lua').Control


Histogram = Class(moho.histogram_methods, Control) {
	--[[ 
	Methods:
		- SetData(table)
		    Format: { 
		                { name = [string], data = [number], color = [colorval] }, 
		                ...
		            }   
		    ex:
		    local stuffs = { 
		        { name = 'cats', data = 10.5, color = 'ff00ff00', },
		        { name = 'dogs', data = 1.597, color = 'aaff2255', },
		        { name = 'bats', data = 8, color = 'ffffffff', },
		        { name = 'robots', data = 2.2, color = '33333333'},
		        { name = 'kerak', data = 4.96, },
		        { name = 'monkeys', data = 0.12, color = 'ff229900', },
		        { name = 'krug', data = 6.75, color = 'ff22324f',  },
		    }
		
		 - SetLineGraphMode()
		    Sets display mode to render a line graph.
		 - SetBarGraphMode()
		    Sets display mode to render a histogram. (default)
		
		 - SetForegroundColor(color)
		    Sets the render color of the axes (default 0xffffffff)
		 - SetBackgroundColor(color)
		    Sets the color of the graph background (default 0x44444444)
		 - SetLineGraphColor(color)
		    Sets the color of the line graph when in line graph mode (default 0xffffffff)
		 - SetFontColor(color)
		    Sets the color of the font used for labels and value marks (default 0xffffffff) 
		 - SetBarWidth(number)
		    Sets the size of each bar in histogram mode, as a percentage of cell width (1.0 leaves no spacing between bars)
	--]]

    __init = function(self, parent, debugname)
        InternalCreateHistogram(self, parent)
        if debugname then
            self:SetName(debugname)
        end
    end,
}


